class Student{
    private String name;//使用private修饰
    private int age;//使用private修饰

    public String getName(){
        return name;
    }
    public void setName(String name){
        this.name = name;
    }
    public void eat(){
        System.out.println(name + "正在吃饭");
    }
}


public class Test{
    public static void main(String[] args){
        Student person1 = new Student();
        person1.setName("李岩");
        System.out.println(person1.getName());
    }
}